package com.bookcloud.java21.chapter6.实现接口65;

public class Dog implements Animal, Pet {
  private String name;

  public Dog(String name) {
    this.name = name;
  }

  @Override
  public void eat() {
    System.out.println("小狗【" + name + "】吃");
  }

  @Override
  public void sleep() {
    System.out.println("小狗【" + name + "】睡");
  }

  @Override
  public void play() {
    System.out.println("小狗【" + name + "】玩");
  }

  @Override
  public String getName() {
    return "小狗的名称：" + name;
  }
}
